{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}

{% block title %}万屏时代OPC--客服账号列表{% endblock %}

{% block panel_heading %}
  万屏时代OPC--客服账号列表
    <div class="pull-right btn-group">
        <a href="{{ url_for('auth_bp.add_admin_user') }}" class="btn btn-xs btn-success" style="margin-right: 5px;">
            新增客服
        </a>
    </div>
{% endblock %}

{% block panel_body %}

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'auth_bp.admin_user_list') }}
    </div>
    {% endif %}

    <table id="admin_user_table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>ID</th>
                <th>账号</th>
                <th>昵称</th>
                <th>角色</th>
                <th>七陌账号</th>
                <th>七陌密码</th>
                <th>是否系统管理员</th>
                <th>是否禁用</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for admin_user in admin_users %}
            <tr>
                <td>{{ admin_user.id }}</td>
                <td>{{ admin_user.username }}</td>
                <td>{{ admin_user.nickname }}</td>
                <td>{{ admin_user.role_display }}</td>
                <td>{{ admin_user.seven_moor_account }}</td>
                <td>{{ admin_user.seven_moor_password }}</td>
                <td>
                    {% if admin_user.is_administrator %}
                    是
                    {% else %}
                    否
                    {% endif %}
                </td>
                <td>{{ admin_user.is_deleted_display }}</td>
                <td>
                    <a href="{{ url_for('auth_bp.edit_admin_user', admin_user_id=admin_user.id) }}" class="btn btn-success">
                      编辑
                    </a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'auth_bp.admin_user_list') }}
    </div>
    {% endif %}
{% endblock %}

